package thread;
public class threadDemo5 {
    public static void main(String[] args) {
        //lambda表达式
        Thread t=new Thread(()->{
            while (true){
                System.out.println("这是thread线程");
                try {
                    Thread.sleep(1000);
                }catch (InterruptedException e){
                    throw new RuntimeException();
                }
            }
        });
        t.start();
        while (true){
            System.out.println("这是main线程");
            try {
                Thread.sleep(1000);
            }catch (InterruptedException e){
                throw new RuntimeException();
            }
        }
    }
}
